package cn.like.stream.helper;

/**
 * Description: Rocket mq 消息延迟级别 <br>
 *
 * @author <a href="mailto:likelovec@gmail.com">like</a>
 * @date 2021-07-18 22:18:17
 * @see Enum
 */
public enum MessageDelayLevel {

    zero(0, "0"),

    // second,
    one_second(1, "1s"),
    five_second(2, "5s"),
    ten_second(3, "10s"),
    thirty_second(4, "30s"),

    // minute
    one_minute(5, "1m"),
    two_minute(6, "2m"),
    three_minute(7, "3m"),
    four_minute(8, "4m"),
    five_minute(9, "5m"),
    six_minute(10, "6m"),
    seven_minute(11, "7m"),
    eight_minute(12, "8m"),
    nine_minute(13, "9m"),
    ten_minute(14, "10m"),
    twenty_minute(15, "20m"),
    thirty_minute(16, "30m"),

    // hour
    one_hour(17, "1h"),
    two_hour(18, "2h"),
    ;

    /**
     * 延迟消息的等级
     */
    private final int level;
    /**
     * 延迟时间
     */
    private final String delayTime;

    MessageDelayLevel(int level, String delayTime) {
        this.level = level;
        this.delayTime = delayTime;
    }

    public int level() {
        return level;
    }
}
